﻿<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:controls="clr-namespace:mediaPrime.Controls"
    >
    <ResourceDictionary.MergedDictionaries>      
        <ResourceDictionary Source="/mediaPrime.Controls;component/FluidKit/Themes/TransitionPresenter.generic.xaml" />

    </ResourceDictionary.MergedDictionaries>
   
    <Style TargetType="{x:Type controls:MPContentLoadAnimation}">
        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
        <Setter Property="VerticalContentAlignment" Value="Stretch"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type controls:MPContentLoadAnimation}">
                    <Grid x:Name="root" RenderTransformOrigin="0.5,0.5">

                        <Grid.RenderTransform>
                            <!--<CompositeTransform/> -->
                            <TranslateTransform></TranslateTransform>
                        </Grid.RenderTransform>

                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="LayoutStates">
                                <VisualState x:Name="AfterLoaded">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames
											BeginTime="00:00:00"
											Storyboard.TargetProperty="(UIElement.Opacity)"
											Storyboard.TargetName="root">
                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                                            <SplineDoubleKeyFrame KeyTime="00:00:00.400" Value="1"/>
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames
											BeginTime="00:00:00"
											Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.X)"
											Storyboard.TargetName="root">
                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="30"/>
                                            <EasingDoubleKeyFrame KeyTime="00:00:00.700" Value="0">
                                                <EasingDoubleKeyFrame.EasingFunction>
                                                    <CubicEase EasingMode="EaseOut"/>
                                                </EasingDoubleKeyFrame.EasingFunction>
                                            </EasingDoubleKeyFrame>
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="AfterUnLoaded">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames
											BeginTime="00:00:00"
											Storyboard.TargetProperty="(UIElement.Opacity)"
											Storyboard.TargetName="root">
                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
                                            <SplineDoubleKeyFrame KeyTime="00:00:00.100" Value="0"/>
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames
											BeginTime="00:00:00"
											Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.X)"
											Storyboard.TargetName="root">
                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                                            <SplineDoubleKeyFrame KeyTime="00:00:00.100" Value="30"/>
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="BeforeLoaded"/>
                                <VisualState x:Name="BeforeUnloaded"/>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <ContentPresenter
							Cursor="{TemplateBinding Cursor}"
							ContentTemplate="{TemplateBinding ContentTemplate}"
							Content="{TemplateBinding Content}"
							HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
							Margin="{TemplateBinding Padding}"
							VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style TargetType="{x:Type controls:MPTileButton}">
        <Setter Property="Background" Value="{DynamicResource MPThemeColorBrush}"></Setter>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"></Setter>
        <Setter Property="Padding" Value="0"></Setter>
        <Setter Property="HorizontalContentAlignment" Value="Stretch"></Setter>
        <Setter Property="VerticalContentAlignment" Value="Stretch"></Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type controls:MPTileButton}">                  
                        <Grid x:Name="grid" RenderTransformOrigin="0.5,0.5" >
                        <Grid.RenderTransform>
                            <ScaleTransform></ScaleTransform>
                        </Grid.RenderTransform>
                   
                        <Border x:Name="borderBackground" BorderBrush="Black" BorderThickness="0" Background="{TemplateBinding Background}"></Border>

                        <ContentPresenter Focusable="False" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"  Content="{TemplateBinding Content}"></ContentPresenter>                    
                    </Grid>
                 
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsFocused" Value="True">
                            <Setter Property="BorderThickness" Value="4" TargetName="borderBackground"></Setter>
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter Property="Background" Value="{DynamicResource MPDisabledBrush}"></Setter>
                        </Trigger>
                        <Trigger Property="IsPressed" Value="True">
                            <Trigger.EnterActions>
                                <BeginStoryboard >
                                    <Storyboard>
                                        <!-- This animation should make the image shrink in the Y direction. -->
                                        <DoubleAnimation Storyboard.TargetName="grid"
										Storyboard.TargetProperty=
                                                "(Grid.RenderTransform).(ScaleTransform.ScaleY)" 
										To="0.90" Duration="0:0:0.25" />

                                        <!-- This animation should make the image shrink in the X direction. -->
                                        <DoubleAnimation Storyboard.TargetName="grid"
										Storyboard.TargetProperty=
                                            "(Grid.RenderTransform).(ScaleTransform.ScaleX)"
										To="0.90" Duration="0:0:0.25" />

                                    </Storyboard>
                                </BeginStoryboard>
                            </Trigger.EnterActions>
                            <Trigger.ExitActions>
                                <BeginStoryboard >
                                    <Storyboard>
                                        <!-- This animation should make the image shrink in the Y direction. -->
                                        <DoubleAnimation Storyboard.TargetName="grid"
										Storyboard.TargetProperty=
                                                "(Grid.RenderTransform).(ScaleTransform.ScaleY)" 
										To="1" Duration="0:0:0.25" />

                                        <!-- This animation should make the image shrink in the X direction. -->
                                        <DoubleAnimation Storyboard.TargetName="grid"
										Storyboard.TargetProperty=
                                            "(Grid.RenderTransform).(ScaleTransform.ScaleX)"
										To="1" Duration="0:0:0.25" />

                                    </Storyboard>
                                </BeginStoryboard>
                            </Trigger.ExitActions>
                        </Trigger>


                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="styleMPTileButtonListBox" TargetType="{x:Type controls:MPTileButton}">
        <Setter Property="Background" Value="{DynamicResource MPThemeColorBrush}"></Setter>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"></Setter>
        <Setter Property="Padding" Value="0"></Setter>
        <Setter Property="HorizontalContentAlignment" Value="Stretch"></Setter>
        <Setter Property="VerticalContentAlignment" Value="Stretch"></Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type controls:MPTileButton}">
                    <Grid x:Name="grid" RenderTransformOrigin="0.5,0.5" >
                        <Grid.RenderTransform>
                            <ScaleTransform></ScaleTransform>
                        </Grid.RenderTransform>

                        <Border x:Name="borderBackground" BorderBrush="Black" BorderThickness="0" Background="{TemplateBinding Background}"></Border>

                        <ContentPresenter Focusable="False" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"  Content="{TemplateBinding Content}"></ContentPresenter>
                    </Grid>

                    <ControlTemplate.Triggers>
                        <Trigger Property="IsFocused" Value="True">
                            <Setter Property="BorderThickness" Value="4" TargetName="borderBackground"></Setter>
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter Property="Background" Value="{DynamicResource MPDisabledBrush}"></Setter>
                        </Trigger>
                        <Trigger Property="IsPressed" Value="True">
                            <Trigger.EnterActions>
                                <BeginStoryboard >
                                    <Storyboard>
                                        <!-- This animation should make the image shrink in the Y direction. -->
                                        <DoubleAnimation Storyboard.TargetName="grid"
										Storyboard.TargetProperty=
                                                "(Grid.RenderTransform).(ScaleTransform.ScaleY)" 
										To="0.95" Duration="0:0:0.25" />

                                        <!-- This animation should make the image shrink in the X direction. -->
                                        <DoubleAnimation Storyboard.TargetName="grid"
										Storyboard.TargetProperty=
                                            "(Grid.RenderTransform).(ScaleTransform.ScaleX)"
										To="0.98" Duration="0:0:0.25" />

                                    </Storyboard>
                                </BeginStoryboard>
                            </Trigger.EnterActions>
                            <Trigger.ExitActions>
                                <BeginStoryboard >
                                    <Storyboard>
                                        <!-- This animation should make the image shrink in the Y direction. -->
                                        <DoubleAnimation Storyboard.TargetName="grid"
										Storyboard.TargetProperty=
                                                "(Grid.RenderTransform).(ScaleTransform.ScaleY)" 
										To="1" Duration="0:0:0.25" />

                                        <!-- This animation should make the image shrink in the X direction. -->
                                        <DoubleAnimation Storyboard.TargetName="grid"
										Storyboard.TargetProperty=
                                            "(Grid.RenderTransform).(ScaleTransform.ScaleX)"
										To="1" Duration="0:0:0.25" />

                                    </Storyboard>
                                </BeginStoryboard>
                            </Trigger.ExitActions>
                        </Trigger>


                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>


    <Style TargetType="{x:Type controls:MPDialog}">
        <Setter Property="WindowStyle" Value="None"></Setter>
        <Setter Property="ResizeMode" Value="NoResize"></Setter>
        <Setter Property="ShowActivated" Value="True"></Setter>
        <Setter Property="ShowInTaskbar" Value="False"></Setter>
        <Setter Property="MinWidth" Value="400"></Setter>
        <Setter Property="AllowsTransparency" Value="True"></Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type controls:MPDialog}">
                    <Grid>               
                        <Border x:Name="borderBackground" Background="Black" Opacity="0"></Border>
                        <Border x:Name="borderContent" Opacity="1" Background="WhiteSmoke"  RenderTransformOrigin="0.5,0.5" HorizontalAlignment="Center" VerticalAlignment="Center">
                            <Border.RenderTransform>
                                <ScaleTransform ScaleX="0" ScaleY="0"></ScaleTransform>
                            </Border.RenderTransform>
                            <Grid >
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto"></RowDefinition>
                                    <RowDefinition Height="*"></RowDefinition>
                                </Grid.RowDefinitions>
                               
                                <TextBlock Margin="16" FontSize="{DynamicResource MPTitleFontSize}" Text="{TemplateBinding Title}"></TextBlock>
                                <ContentPresenter Margin="16" Grid.Row="1" Content="{TemplateBinding Content}" Width="{TemplateBinding ContentWidth}" Height="{TemplateBinding ContentHeight}"></ContentPresenter>
                            </Grid>
                        </Border>
                        </Grid>
                   
                    <ControlTemplate.Resources>
                        <DoubleAnimation x:Key="doubleAnimationBackgroundFadeIn" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="borderBackground" From="0.0" To="0.9" Duration="0:0:0.250"></DoubleAnimation>
                        <DoubleAnimation x:Key="doubleAnimationContentFadeIn" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="borderContent" From="0.0" To="1" Duration="0:0:0.250"></DoubleAnimation>

                        <DoubleAnimation  x:Key="doubleAnimationContentScaleXIncrease" Storyboard.TargetName="borderContent"
										Storyboard.TargetProperty=
                                                "(Border.RenderTransform).(ScaleTransform.ScaleY)" 
										To="1"  Duration="0:0:0.250" />

                        <!-- This animation should make the image shrink in the X direction. -->
                        <DoubleAnimation  x:Key="doubleAnimationContentScaleYIncrease" Storyboard.TargetName="borderContent"
										Storyboard.TargetProperty=
                                            "(Border.RenderTransform).(ScaleTransform.ScaleX)" 
										To="1"  Duration="0:0:0.250" />


                        <DoubleAnimation x:Key="doubleAnimationContentScaleXDecrease" Storyboard.TargetName="borderContent"
										Storyboard.TargetProperty=
                                            "(Border.RenderTransform).(ScaleTransform.ScaleX)" 
										To="0" Duration="0:0:0.250" />
                        <DoubleAnimation x:Key="doubleAnimationContentScaleYDecrease" Storyboard.TargetName="borderContent"
										Storyboard.TargetProperty=
                                            "(Border.RenderTransform).(ScaleTransform.ScaleY)"
										To="0" Duration="0:0:0.250" />
                        <DoubleAnimation x:Key="doubleAnimationBackgroundFadeOut" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="borderBackground" To="0" Duration="0:0:0.250"></DoubleAnimation>
                        <DoubleAnimation x:Key="doubleAnimationContentFadeOut" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="borderContent" To="0" Duration="0:0:0.250"></DoubleAnimation>

                    </ControlTemplate.Resources>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

  
    <Style x:Key="styleMPSideMenuItem" TargetType="ListBoxItem">
        <Setter Property="FocusVisualStyle" Value="{x:Null}"></Setter>
        <Setter Property="Focusable" Value="False"></Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ListBoxItem">
                    <Button VerticalContentAlignment="Center" Command="{x:Static controls:MPSideMenu.MPMenuItemClickCommand}" CommandParameter="{Binding}" IsEnabled="{Binding IsEnabled}" Padding="16,8"  Foreground="{DynamicResource MPMenuItemForeground}" FontSize="{DynamicResource MPMenuItemFontSize}"  Height="{DynamicResource MPMenuItemHeight}" Content="{Binding}" >
                        <Button.Template>
                            <ControlTemplate TargetType="Button">
                                <Grid>
                                    <Border x:Name="borderBackground"   Background="{DynamicResource MPThemeColorBrush}"></Border>
                                    <controls:MPContentLoadAnimation>
                                        <ContentPresenter VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Margin="{TemplateBinding Padding}" ></ContentPresenter>
                                    </controls:MPContentLoadAnimation>
                                </Grid>
                                <ControlTemplate.Triggers>
                            
                                    <MultiDataTrigger>
                                        <MultiDataTrigger.Conditions>
                                            <Condition Binding="{Binding  RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type ListBoxItem}}, Path=IsSelected}"
                                            Value="True"></Condition>
                                            <Condition Binding="{Binding Path=IsFocused, RelativeSource={RelativeSource Self}}"
                                            Value="True"></Condition>
                                        </MultiDataTrigger.Conditions>
                                        <MultiDataTrigger.Setters>
                                            <Setter Property="Background" Value="{DynamicResource MPHighlightedThemeColorBrush}" TargetName="borderBackground"/>
                                        </MultiDataTrigger.Setters>
                                    </MultiDataTrigger>
                                    <MultiDataTrigger>
                                        <MultiDataTrigger.Conditions>
                                            <Condition Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type ListBoxItem}}, Path=IsSelected}"
                                            Value="False"></Condition>
                                            <Condition Binding="{Binding Path=IsFocused, RelativeSource={RelativeSource Self}}"
                                            Value="True"></Condition>
                                        </MultiDataTrigger.Conditions>
                                        <MultiDataTrigger.Setters>
                                            <Setter Property="Background" Value="{DynamicResource MPHighlightedThemeColorBrush}" TargetName="borderBackground"/>
                                        </MultiDataTrigger.Setters>
                                    </MultiDataTrigger>
                                    <MultiDataTrigger>
                                        <MultiDataTrigger.Conditions>
                                            <Condition Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type ListBoxItem}}, Path=IsSelected}"
                                            Value="True"></Condition>
                                            <Condition Binding="{Binding IsFocused, RelativeSource={RelativeSource Self}}"
                                            Value="False"></Condition>
                                        </MultiDataTrigger.Conditions>
                                        <MultiDataTrigger.Setters>
                                            <Setter Property="Background" Value="{DynamicResource MPSelectedThemeColorBrush}" TargetName="borderBackground"/>
                                        </MultiDataTrigger.Setters>
                                    </MultiDataTrigger>
                                </ControlTemplate.Triggers>
                            </ControlTemplate>
                        </Button.Template>
                        <Button.Style>
                            <Style TargetType="Button">
                                <Setter Property="FocusVisualStyle" Value="{x:Null}"></Setter>
                            </Style>
                        </Button.Style>
                    </Button>

                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="styleMPMenuItem" TargetType="ListBoxItem">
        <Setter Property="FocusVisualStyle" Value="{x:Null}"></Setter>
        <Setter Property="Focusable" Value="False"></Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ListBoxItem">
                    <controls:MPContentLoadAnimation>
                        <controls:MPTileButton IsEnabled="{Binding IsEnabled}" Padding="16,8" Command="{x:Static controls:MPMenu.MPMenuItemClickCommand}" CommandParameter="{Binding}" VerticalContentAlignment="Center" Foreground="{DynamicResource MPMenuItemForeground}" FontSize="{DynamicResource MPMenuItemFontSize}" Margin="8" Height="{DynamicResource MPMenuItemHeight}">
                            <ContentPresenter Focusable="False"></ContentPresenter>
                        </controls:MPTileButton>
                    </controls:MPContentLoadAnimation>

                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="styleMPMenuHeaderItem" TargetType="ListBoxItem">
        <Setter Property="FocusVisualStyle" Value="{x:Null}"></Setter>
        <Setter Property="Focusable" Value="False"></Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ListBoxItem">
                    <controls:MPContentLoadAnimation>
                        <Grid Height="{DynamicResource MPMenuHeaderItemHeight}">
                            <TextBlock Padding="16,0" VerticalAlignment="Center" Text="{Binding Header}" Foreground="{DynamicResource MPMenuHeaderItemForeground}" FontSize="{DynamicResource MPMenuItemFontSize}"  Focusable="False"></TextBlock>
                        </Grid>
                    </controls:MPContentLoadAnimation>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <DataTemplate x:Key="dataTemplateMPListBoxGroup">
        <controls:MPContentLoadAnimation>
            <Grid Height="{DynamicResource MPMenuHeaderItemHeight}">
                <TextBlock Padding="16,0" VerticalAlignment="Center" Text="{Binding Name}" Foreground="{DynamicResource MPMenuHeaderItemForeground}" FontSize="{DynamicResource MPMenuItemFontSize}"  Focusable="False"></TextBlock>
            </Grid>
        </controls:MPContentLoadAnimation>
    </DataTemplate>

    <Style x:Key="styleMPListBoxItem" TargetType="ListBoxItem">
        <Setter Property="FocusVisualStyle" Value="{x:Null}"></Setter>
        <Setter Property="Focusable" Value="False"></Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ListBoxItem">
                    <controls:MPContentLoadAnimation>
                        <controls:MPTileButton Style="{StaticResource styleMPTileButtonListBox}" IsEnabled="{Binding IsEnabled}" Padding="16,8" Command="{x:Static controls:MPListBox.MPItemClickCommand}" CommandParameter="{Binding}" VerticalContentAlignment="Center" Foreground="{DynamicResource MPMenuItemForeground}" FontSize="{DynamicResource MPMenuItemFontSize}" Margin="8" Height="{DynamicResource MPMenuItemHeight}">
                            <ContentPresenter Focusable="False"></ContentPresenter>
                        </controls:MPTileButton>
                    </controls:MPContentLoadAnimation>

                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="styleMPMenuItemSeparator" TargetType="ListBoxItem">
        <Setter Property="FocusVisualStyle" Value="{x:Null}"></Setter>
        <Setter Property="Focusable" Value="False"></Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ListBoxItem">
                    <Grid Focusable="False" Height="{DynamicResource MPMenuItemSeparatorHeight}"></Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="{x:Type controls:MPMenu}">
        <Setter Property="BorderThickness" Value="0"></Setter>
        <Setter Property="Padding" Value="0"></Setter>
        <Setter Property="Background" Value="Transparent"></Setter>
        <Setter Property="KeyboardNavigation.DirectionalNavigation" Value="Cycle"></Setter>
        <Setter Property="HorizontalContentAlignment" Value="Stretch"></Setter>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"></Setter>
        <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Disabled"></Setter>
        <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Disabled"></Setter>
        <Setter Property="ItemContainerStyleSelector">
            <Setter.Value>
                <controls:MPMenuItemStyleSelector Default="{StaticResource styleMPMenuItem}" Separator="{StaticResource styleMPMenuItemSeparator}" Header="{StaticResource styleMPMenuHeaderItem}"></controls:MPMenuItemStyleSelector>
            </Setter.Value>
        </Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ListBox}">
                    <Border x:Name="Bd" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="0" SnapsToDevicePixels="true">
                        <ScrollViewer Focusable="false" Padding="{TemplateBinding Padding}">
                            <ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
                        </ScrollViewer>
                    </Border>
                    <ControlTemplate.Triggers>
                     
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="IsGrouping" Value="true"/>
                                <Condition Property="VirtualizingPanel.IsVirtualizingWhenGrouping" Value="false"/>
                            </MultiTrigger.Conditions>
                            <Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
                        </MultiTrigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Style.Resources>

            <Style TargetType="ListBoxItem">
                <Setter Property="FocusVisualStyle" Value="{x:Null}"></Setter>
                <Setter Property="Focusable" Value="False"></Setter>
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type ListBoxItem}">
                            <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>

            </Style>
            <SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="Transparent" />

            <SolidColorBrush x:Key="{x:Static SystemColors.ControlBrushKey}" Color="Transparent" />

        </Style.Resources>
    </Style>
    <Style TargetType="{x:Type controls:MPSideMenu}">
        <Setter Property="BorderThickness" Value="0"></Setter>
        <Setter Property="Padding" Value="0"></Setter>
        <Setter Property="Background" Value="Transparent"></Setter>
        <Setter Property="KeyboardNavigation.DirectionalNavigation" Value="Cycle"></Setter>
        <Setter Property="HorizontalContentAlignment" Value="Stretch"></Setter>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"></Setter>
       
        <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Disabled"></Setter>
        <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Disabled"></Setter>
        <Setter Property="ItemContainerStyleSelector">
            <Setter.Value>
                <controls:MPMenuItemStyleSelector Default="{StaticResource styleMPSideMenuItem}" Separator="{StaticResource styleMPMenuItemSeparator}" Header="{StaticResource styleMPMenuHeaderItem}"></controls:MPMenuItemStyleSelector>
            </Setter.Value>
        </Setter>

        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ListBox}">
                    <Border x:Name="Bd" Focusable="False" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="0" SnapsToDevicePixels="true">
                        <ScrollViewer Focusable="false" Padding="{TemplateBinding Padding}">
                            <ItemsPresenter Focusable="False"  SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
                        </ScrollViewer>
                    </Border>
                    <ControlTemplate.Triggers>
                      
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="IsGrouping" Value="true"/>
                                <Condition Property="VirtualizingPanel.IsVirtualizingWhenGrouping" Value="false"/>
                            </MultiTrigger.Conditions>
                            <Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
                        </MultiTrigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Style.Resources>
            <Style TargetType="ListBoxItem">
                <Setter Property="FocusVisualStyle" Value="{x:Null}"></Setter>
                <Setter Property="Focusable" Value="False"></Setter>
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type ListBoxItem}">
                            <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>

            </Style>
            <SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="Transparent" />
            <SolidColorBrush x:Key="{x:Static SystemColors.ControlBrushKey}" Color="Transparent" />

      

        </Style.Resources>
    </Style>

  

    <Style TargetType="{x:Type controls:MPListBox}">
        <Setter Property="BorderThickness" Value="0"></Setter>
        <Setter Property="Padding" Value="0"></Setter>
        <Setter Property="Background" Value="Transparent"></Setter>
        <Setter Property="KeyboardNavigation.DirectionalNavigation" Value="Cycle"></Setter>
        <Setter Property="HorizontalContentAlignment" Value="Stretch"></Setter>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"></Setter>
        <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"></Setter>
        <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Disabled"></Setter>
        <Setter Property="VirtualizingPanel.CacheLength" Value="1,1"></Setter>
        <Setter Property="VirtualizingPanel.CacheLengthUnit" Value="Item"></Setter>
        <Setter Property="DefaultGroupStyle">
            <Setter.Value>
                <GroupStyle HeaderTemplate="{StaticResource dataTemplateMPListBoxGroup}">                    
                </GroupStyle>
            </Setter.Value>
        </Setter>
        <Setter Property="ItemContainerStyleSelector">
            <Setter.Value>
                <controls:MPMenuItemStyleSelector Default="{StaticResource styleMPListBoxItem}" Separator="{StaticResource styleMPMenuItemSeparator}" Header="{StaticResource styleMPMenuHeaderItem}"></controls:MPMenuItemStyleSelector>
            </Setter.Value>
        </Setter>
        
        <Setter Property="ItemsPanel">
            <Setter.Value>             
                    <ItemsPanelTemplate>
                        <VirtualizingStackPanel />
                    </ItemsPanelTemplate>         

            </Setter.Value>
        </Setter>

        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ListBox}">
                    <Border x:Name="Bd" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="0" SnapsToDevicePixels="true">
                        <ScrollViewer CanContentScroll="True" Focusable="false" Padding="{TemplateBinding Padding}">
                            <ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
                        </ScrollViewer>
                    </Border>
                    <ControlTemplate.Triggers>
                        
                        <MultiTrigger>
                            <!--<MultiTrigger.Conditions>
                                <Condition Property="IsGrouping" Value="true"/>
                                <Condition Property="VirtualizingPanel.IsVirtualizingWhenGrouping" Value="false"/>
                            </MultiTrigger.Conditions>
                            <Setter Property="ScrollViewer.CanContentScroll" Value="false"/>-->
                        </MultiTrigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Style.Resources>
            <Style TargetType="ListBoxItem">
                <Setter Property="FocusVisualStyle" Value="{x:Null}"></Setter>
                <Setter Property="Focusable" Value="False"></Setter>
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type ListBoxItem}">
                            <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>

            </Style>
            <SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="Transparent" />
            <SolidColorBrush x:Key="{x:Static SystemColors.ControlBrushKey}" Color="Transparent" />



        </Style.Resources>
    </Style>


    <Style  TargetType="{x:Type controls:MPCheckBox}">
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="Background" Value="Transparent"></Setter>
        <Setter Property="Foreground" Value="Black"></Setter>
        <Setter Property="BorderBrush" Value="Gray"></Setter>
        <Setter Property="Padding" Value="8,0,0,0"></Setter>
        <Setter Property="FontSize" Value="20"></Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type controls:MPCheckBox}">
                    <Grid x:Name="templateRoot" Background="Transparent" >
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>
                        <Border Height="32" Width="32"  x:Name="checkBoxBorder" BorderThickness="2" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}"  Margin="1" VerticalAlignment="Center" >
                      
                                <Path x:Name="optionMark"  Data="F1 M 9.97498,1.22334L 4.6983,9.09834L 4.52164,9.09834L 0,5.19331L 1.27664,3.52165L 4.255,6.08833L 8.33331,1.52588e-005L 9.97498,1.22334 Z " Fill="{TemplateBinding BorderBrush}" Margin="4" Visibility="Hidden" Stretch="Uniform"/>               
                        </Border>
                        <ContentPresenter VerticalAlignment="Center" x:Name="contentPresenter" Grid.Column="1" Focusable="False"  Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" />
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsFocused" Value="True">
                            <Setter Property="BorderThickness" TargetName="checkBoxBorder" Value="4"/>
                        </Trigger>
                       
                        <Trigger Property="IsEnabled" Value="false">
                         
                      
                        </Trigger>
                        <Trigger Property="IsPressed" Value="true">
                            
                        
                        </Trigger>
                        <Trigger Property="IsChecked" Value="true">
                            <Setter Property="Visibility" TargetName="optionMark" Value="Visible"/>
                  
                        </Trigger>
                        <Trigger Property="IsChecked" Value="{x:Null}">
                            <Setter Property="Visibility" TargetName="optionMark" Value="Hidden"/>

                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="controls:MPNumPad">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="controls:MPNumPad">
                    <UniformGrid Columns="3" Rows="3">
                        <UniformGrid.Resources>
                            <Style TargetType="controls:MPTileButton">
                                <Setter Property="Width" Value="48"></Setter>
                                <Setter Property="Height" Value="48"></Setter>
                                <Setter Property="HorizontalContentAlignment" Value="Center"></Setter>
                                <Setter Property="VerticalContentAlignment" Value="Center"></Setter>
                                <Setter Property="Margin" Value="8"></Setter>
                                <Setter Property="Foreground" Value="White"></Setter>
                                <Setter Property="FontSize" Value="20"></Setter>
                            </Style>
                        </UniformGrid.Resources>
                        <controls:MPTileButton x:Name="PART_1" Content="1"></controls:MPTileButton>
                        <controls:MPTileButton x:Name="PART_2" Content="2"></controls:MPTileButton>
                        <controls:MPTileButton x:Name="PART_3" Content="3"></controls:MPTileButton>
                        <controls:MPTileButton x:Name="PART_4" Content="4"></controls:MPTileButton>
                        <controls:MPTileButton x:Name="PART_5" Content="5"></controls:MPTileButton>
                        <controls:MPTileButton x:Name="PART_6" Content="6"></controls:MPTileButton>
                        <controls:MPTileButton x:Name="PART_7" Content="7"></controls:MPTileButton>
                        <controls:MPTileButton x:Name="PART_8" Content="8"></controls:MPTileButton>
                        <controls:MPTileButton x:Name="PART_9" Content="9"></controls:MPTileButton>
                        <controls:MPTileButton x:Name="PART_CLEAR" Content="C"></controls:MPTileButton>
                        <controls:MPTileButton x:Name="PART_0" Content="0"></controls:MPTileButton>
                        <controls:MPTileButton x:Name="PART_REMOVE" Content="R"></controls:MPTileButton>
                    </UniformGrid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
</ResourceDictionary>